import request from '@/utils/request'
// 请求商品列表
const fetchCates = (params = {}) => (
  request.get('/cateLists', { params })
)
// 新增商品分类
const addCate = (params = {}) => {
  return request.post('/addCate', params)
}
// 获取分类详情
const fetchCateDetail = id => {
  return request.get('/getCate', { params: { id } })
}
// 修改商品分类
const updateCate = (params = {}) => {
  return request.put('/updateCate', params)
}
// 删除商品分类
const delCate = id => {
  return request.delete('/delCate', { params: { id } })
}
export {
  fetchCates,
  addCate,
  fetchCateDetail,
  updateCate,
  delCate
}
